<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
    <%--常量--%>
    <%@ include file="/common/constHead.jsp"%>
    <%--jQuery--%>
    <%@ include file="/common/jqueryHead.jsp"%>
    <%--jo--%>
    <%@ include file="/common/joHead.jsp"%>
    <%--bootstrap和字体--%>
    <%@ include file="/common/bootstrapHead.jsp"%>
    <%--layer--%>
    <%@ include file="/common/layerHead.jsp"%>
    <%--公共--%>
    <%@ include file="/common/commonHead.jsp"%>
    <%--日期选择--%>
    <%@ include file="/common/dateHead.jsp"%>
    <%@ include file="/common/uploadHead.jsp"%>
    <title>自然保护地实例表单</title>
    <script type="text/javascript">
        $(function(){
            var jParams = {
                "PKName" : "id",//主键属性名
                "formDataUrl" : "travel/natureReserveCheck/get.action"	//查询
            };
            joForm.initFormPage(jParams);//初始化
            loadReserveInfo();
        });
        //初始化表单值前处理
        joForm.initFormValueBefore = function(oJson){
            oJson.createTime = jo.formatDate(oJson.createTime);
            oJson.checkTime = jo.formatDate(oJson.checkTime);
        };
        joForm.initFormValueAfter = function(){
            jo.form2Label("pageForm");
        };
        //同意调整申请
        function agreeApply(){
            if(joForm.params.PKValue){
                jo.showDialog($("#applyDiv"), "APPLY_WIN", true, {"title":"新增保护地审核","area":["350px","250px"],"btn":["确定","关闭"],"btn1":function(idx){
                    if(jo.checkForm($("#applyForm"))){
                        jo.showLoading();
                        jo.postAjax("travel/reserve/agreeApply", {"id":joForm.params.PKValue,"opinion":$("#opinion").val()}, function(json){
                            if(json && json.code == 0){
                                top.jo.showMsg("审核完毕!");
                                if(top.main.joView.inited){
                                    top.main.joView.reloadCurrentPage();
                                }
                                location.reload();
                            }else{
                                jo.showMsg(json.info);
                            }
                            jo.showLoading(false);
                        }, true);
                        jo.close(idx);//关闭弹窗
                    }
                }});
            }
        }
        //拒绝调整申请
        function disagreeApply(){
            if(joForm.params.PKValue){
                jo.showDialog($("#applyDiv"), "APPLY_WIN", true, {"title":"新增保护地审核","area":["350px","250px"],"btn":["确定","关闭"],"btn1":function(idx){
                    if(jo.checkForm($("#applyForm"))){
                        jo.showLoading();
                        jo.postAjax("travel/reserve/disagreeApply", {"id":joForm.params.PKValue, "opinion":$("#opinion").val()}, function(json){
                            if(json && json.code == 0){
                                top.jo.showMsg("审核完毕!");
                                if(top.main.joView.inited){
                                    top.main.joView.reloadCurrentPage();
                                }
                                location.reload();
                            }else{
                                jo.showMsg(json.info);
                            }
                            jo.showLoading(false);
                        }, true);
                        jo.close(idx);//关闭弹窗
                    }
                }});
            }
        }
        //加载自然保护地信息
        function loadReserveInfo(){
            if(joForm.params.PKValue){
                jo.postAjax("travel/reserve/getReserve", {id:joForm.formData.id}, function(json){
                    if(json && json.code == "0" && json.data && json.data.length > 0){
                        var info = json.data[0];
                        $(".span_val1").each(function(idx, ele){
                            if(ele.id.substring(2)=="buildDate"){
                                var time = jo.formatDate(info[ele.id.substring(2)]);
                                $(ele).text(jo.getDefVal(time, ''));
                            }else{
                                $(ele).text(jo.getDefVal(info[ele.id.substring(2)], ''));
                            }
                        });
                    }
                }, true);
            }
        }
    </script>
</head>
<body class="bg">

<%--模态框--%>
<div id="applyDiv" style="display: none;padding: 15px;width: 350px;">
    <form id="applyForm" class="form" id="exportForm">
        <div class="form-group">
            <label class="control-label">请输入您的审核意见：&nbsp;</label>
            <textarea id="opinion" name="opinion" class="form-control input-sm" rows="4" ErrEmpty="请填写审核意见"></textarea>
        </div>
    </form>
</div>
<%--/模态框--%>

<div class="container-fluid">
    <div class="row">
        <div class="col-xs-12 col-lg-12 col-md-12 col-sm-12" style="background-color: #e4eaec;">
            <%--按钮栏--%>
            <div class="form-group button-bar" style="padding: 0px 0px; margin: 7px 0px;">
                <button type="button" isShow="joForm.formData.state==1" class="btn btn-sm btn-outline btn-info" onclick="agreeApply()">
                    <i class="fa fa-check-circle-o" aria-hidden="true"></i>&nbsp;同意调整
                </button>
                <button type="button" isShow="joForm.formData.state==1" class="btn btn-sm btn-outline btn-warning" onclick="disagreeApply()">
                    <i class="fa fa-times-circle-o" aria-hidden="true"></i>&nbsp;拒绝调整
                </button>
            </div>
            <%--按钮栏--%>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12 col-lg-12 col-md-12 col-sm-12">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        审核信息
                        <div class="flex-control fa fa-chevron-down"></div>
                    </h3>
                </div>
                <div class="panel-body">
                    <form id="pageForm" name="pageForm" action="" method="post">
                        <table class="table table-bordered  dataTables-example dataTable no-footer">
                            <tr>
                                <td width="15%" class="active" align="">申请状态</td>
                                <td class="tnt">
                                    <select name="state" class="form-control input-sm">
                                        <option value=""></option>
                                        <option value="1">待审批</option>
                                        <option value="2">审批通过</option>
                                        <option value="3">审批不通过</option>
                                    </select>
                                </td>
                                <td width="15%" class="active" align="">申请审批时间</td>
                                <td class="tnt">
                                    <input type="text" name="createTime" class="form-control input-sm" />
                                </td>
                            </tr>
                            <tr>
                                <td class="active" align="">审批时间</td>
                                <td class="tnt">
                                    <input type="text" name="checkTime" class="form-control input-sm" />
                                </td>
                                <td class="active" align="">审批结果</td>
                                <td class="tnt">
                                    <input type="text" name="checkResult" class="form-control input-sm" />
                                </td>
                            </tr>
                            <tr>
                                <td class="active" align="">审批意见</td>
                                <td class="tnt" colspan="3">
                                    <textarea  name="opinion" class="form-control input-sm" ></textarea>
                                </td>
                            </tr>
                        </table>
                    </form>
                </div>
            </div>

        </div>

    </div>
    <div class="row">
        <div class="col-xs-12 col-lg-12 col-md-12 col-sm-12">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        新增自然保护地详情
                        <div class="flex-control fa fa-chevron-down"></div>
                    </h3>
                </div>
                <div class="panel-body">
                    <%--胶囊选项卡--%>
                    <ul class="nav nav-tabs" style="margin-top: 5px;">
                        <li class=""></li>
                        <li class="active"><a class="cursor-hand" data-target="#base" data-toggle="pill">基 本 信 息</a></li>
                        <li class=""><a class="cursor-hand" data-target="#sky" data-toggle="pill">功能分区信息</a></li>
                        <li class=""><a class="cursor-hand" data-target="#youke" data-toggle="pill">产业与设施状况</a></li>
                    </ul>
                    <div class="tab-content" style="margin-top: 5px;">
                        <%--基本信息--%>
                        <div class="tab-pane fade in active" id="base">
                            <table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
                                <tr>
                                    <td width="15%" class="active" align="">保护地名称</td>
                                    <td class="tnt">
                                        <span id="a_name" class="span_val1"></span>
                                    </td>
                                    <td width="15%" class="active" align="">保护区类型</td>
                                    <td class="tnt">
                                        <span id="a_categoryId" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">所属部门</td>
                                    <td class="tnt">
                                        <span id="a_pareantDept" class="span_val1"></span>
                                    </td>
                                    <td width="15%" class="active" align="">保护地级别</td>
                                    <td class="tnt">
                                        <span id="a_natureGrade" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">管理运营机构</td>
                                    <td class="tnt">
                                        <span id="a_manageOrganization" class="span_val1"></span>
                                    </td>
                                    <td class="active" align="">地理位置</td>
                                    <td class="tnt">
                                        <span id="a_provinceCity" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">成立时间</td>
                                    <td class="tnt">
                                        <span id="a_buildDate" class="span_val1"></span>
                                    </td>
                                    <td class="active" align="">保护区面积(k㎡)</td>
                                    <td class="tnt">
                                        <span id="a_area" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">自然地理与人文社会情况</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_geoHuman" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">保护对象<br />(核心生态系统特征)</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_proAnimal" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">土地利用状况</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_landUse" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">生物多样性情况</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_bioDiversity" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">资源状况与价值</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_resourceState" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">交通信息</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_traficInfo" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">保护现状</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_proState" class="span_val1"></span>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <!-- 空间信息 -->
                        <div class="tab-pane fade in" id="sky">
                            <table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
                                <!-- 功能分区 -->
                                <tr>
                                    <td width="15%" class="active" align="">保护区坐标</td>
                                    <td class="tnt">
                                        <span id="a_reservearea" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="15%" class="active" align="">实验区坐标</td>
                                    <td class="tnt">
                                        <span id="a_experimentalarea" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="15%" class="active" align="">缓冲区坐标</td>
                                    <td class="tnt">
                                        <span id="a_bufferarea" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="15%" class="active" align="">核心区坐标</td>
                                    <td class="tnt">
                                        <span id="a_core" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="15%" class="active" align="">自然保护地坐标</td>
                                    <td class="tnt">
                                        <span id="a_position" class="span_val1"></span>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <%--产业与设施--%>
                        <div class="tab-pane fade in" id="youke">
                            <table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
                                <tr>
                                    <td width="15%" class="active" align="">特色产品</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_specity" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="15%" class="active" align="">传统产业情况</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_traditionState" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">基础设施</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_basicBuild" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">服务设施</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_serverBuild" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">出行指南</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_travleGuide" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">社区人口与社会经济状况</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_humanEconomic" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">社区参与状况</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_patticipateState" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active" align="">直接或间接就业人数</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_jobState" class="span_val1"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="15%" class="active" align="">科研项目</td>
                                    <td class="tnt" colspan="3">
                                        <span id="a_researchProject" class="span_val1"></span>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script
        src="<%=URL_STATIC%>static/plugin/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script type="text/javascript">
    jo.formatUI();//格式化jo组件
</script>
</body>
</html>
